﻿@model HanGu.Entity.MemberInfo
@{
    ViewBag.Title = "修改密码——我的汉古";
    Layout = "~/Views/Shared/Main.cshtml";
    TempData["sidecalss"] = "EveryDayWisdom";
}
@section Header
{
    <style>
        .contentLeft
        {
            width: 100%;
        }
        #partContent
        {
            width: 100%;
        }
        .movieContain
        {
            width: 100%;
            margin-top: 5px;
        }
    </style>
}
@section Banner
{
    @Html.Partial("Banner")
}
@section Content{
    <div class="contentLeft">
        <table cellpadding="0" cellspacing="0" id="partContent" style="height: 100%;">
            <tr>
                <td>
                    <div class="ContentTitle">
                        <div class="ContentTitleLeft">
                            <img src="/Content/images/vipmyhanguTitle.gif" width="145" height="26" alt=""></div>
                        <div class="ContentTitleRight">
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td class="content">
                    <div class="contentLeft" style="height: 550px; width: 150px; background-color: #ccc">
                        @Html.Partial("vipLeftMenu")
                    </div>
                    <div class="contentLeft MyInfo" style="height: 100%; width: 500px; margin-left: 20px;">
                        <form action="/vip/EditPwd" id="EditPwdForm">
                        <p>
                            <label>
                                &nbsp;&nbsp;&nbsp;原密码：</label>
                            <input type="password" name="oldpassword" id="oldpassword" class="login_input required" maxlength="20"
                                minlength="6" style="width: 150px" />
                        </p>
                        <p>
                            <label>
                                &nbsp;&nbsp;&nbsp;密&nbsp;&nbsp;&nbsp;码：</label>
                            <input type="password" name="password" id="password" class="login_input required"
                                maxlength="30" minlength="6" style="width: 150px" />
                        </p>
                        <p>
                            <label>
                                确认密码：</label>
                            <input type="password" name="password2" id="password2" class="login_input required"
                                equalto="#password" style="width: 150px" />
                        </p>                        
                        
                        <div class="login_bar">
                            <div style="width: 60px; float: left">
                                <input class="sub" type="submit" value="确定" style="width: 50px" /></div>
                        </div>
                        </form>
                    </div>
                </td>
            </tr>
        </table>
    </div>
}
@section Side{
    @Html.Partial("Side")
}
<script>
    $(function () {
        $("#EditPwdForm").validate(
    { submitHandler: function (_this) {
        $this = $(_this);
        var oldpassword = $("#oldpassword", $this).val();
        var password = $("#password", $this).val();
        var password2 = $("#password", $this).val();
        $.ajax({
            type: "POST",
            url: $this.attr("action"),
            data: "oldpassword=" + oldpassword + "&Pwd=" + password,
            success: function (data) {
                var json = eval("(" + data + ")");
                if (json.statusCode == 200) {
                    alert("修改成功，请重新登录");
                    top.location.href = "/vip/login";// json.forwardUrl;
                }
                else {
                    alert(json.message);
                }
            }
        });
    }
    }
);
    });
    
</script>
